/**
 *@ClassName common
 *@Description TODO
 *@Author wangming
 *@Date 2020-03-18 17:37
 *@Version 1.0
 **/

// 转义返回报文，为了显示xml报文
export function htmlFilter(content) {
  content = content.replace(/</g, '&lt;').replace(/>/g, '&gt;');

  // 单引号
  // content = content.replace(/'/g, '&#039;');

  // content = content.replace(/"/g, "'");
  return content;
}


export const colorList = [ '#a0d911', '#52c41a','#13c2c2','#1890ff', '#2f54eb', '#722ed1', '#eb2f96','#fa8c16', '#faad14', '#fadb14', '#f5222d' ,'#fa541c'];

export const errorColor = "#f5222d"; //出错量

export const successColor = "#52c41a"; //成功量

export const countColor = "#fa8c16";

export const minColor = "#eb2f96";

export const maxColor = "#722ed1";

export const avgColor = "#1890ff";

export const allCountColor = "#fadb14";

export const remindContent = [
  {
    title:"Log4x基础语法",
    content: [
      {
        name: "日志搜索语言大全",
        text: "一般的日志关键字搜索其结果都是信息量巨大，且脚本为后台非格式化数据，要想精确搜索到想要的内容，“老司机”教你几招！",
        highLineText: "请注意：1、以下示例语法中AND，OR和NOT是区分大小写的，必须以大写形式输入。2、带字段的查询,如appName：crm-app*,提供以下字段:hostName(主机名), containerId(容器Id), appName(应用名), sysCode(系统域), traceId, opCode(操作员号),, name(服务名)location(报错类),thread(线程名), message(异常报文), stack(异常堆栈)"
      },
      {
        name: "入门篇：掌握语法",
        text: "搜索语法非常接近Lucene语法。如果不指定要搜索的消息字段，默认情况下，所有消息字段都包含在搜索中。\n" +
        "包含术语ssh的消息：ssh" +
        "\n" +
        "包含术语ssh或login的消息：ssh login" +
        "\n" +
        '包含术语ssh或login的消息："ssh login"'
      },
      {
        name: "进阶篇：语法排列组合",
        text: "字段type包含ssh的消息  type:ssh" +
        "\n" +
        "字段type包含ssh或login的消息  type:( ssh login )" +
        "\n" +
        '字段type准确包含短语ssh login的消息  type:"ssh login"' +
        "\n" +
        "不包含字段type的消息  _missing_:type" +
        "\n" +
        "具有字段type的消息  _exists_:type"
      },
      {
        name: "高级篇：来点运算法则",
        text: "默认情况下，所有的术语或短语都是OR连接的，所以返回至少有一个命中的所有消息。\n" +
        "您可以使用布尔运算符和组来执行组合查询\n" +
        '"ssh login" AND source:example.org\n' +
        "或者这样\n" +
        '("ssh login" AND (source:example.org OR source:another.example.org) ) OR _exists_:always_find_me\n' +
        "您还可以使用NOT运算符\n" +
        '"ssh login" AND NOT source:example.orgNOT example.org'
      },
      {
        name: "黑洞篇：……",
        text: "代码高手表示：以上都不算什么，我要用符号'征服宇宙'……\n" + "日志中心系统淡定表示：符号什么的我们统统都支持，还能支持更多！\n" +
        "\n" +
        "通配符：使用?替换单个字符或*替换零个或多个字符\n" +
        "source:*.org\n" +
        "source:exam?le.org\n" +
        "source:exam?le.*\n" +
        "\n" +
        "模糊性：您可以搜索类似的词语：此示例使用默认距离为2的Damerau-Levenshtein距离，并将匹配“ssh login”和“example.org”（在查询中有意拼写错误）\n" +
        "ssh logni~\n" +
        "source:exmaple.org~\n" +
        "你可以改变这样的距离\n" +
        "source:exmaple.org~1\n" +
        "\n" +
        "数字字段支持范围查询。方括号中的范围是包含的，大括号是排他性的，甚至可以组合\n" +
        "http_response_code:[500 TO 504]\n" +
        "http_response_code:{400 TO 404}\n" +
        "bytes:{0 TO 64]\n" +
        "http_response_code:Ύ TO 64}\n" +
        "\n" +
        "您也可以进行无边界搜索\n" +
        "http_response_code :> 400\n" +
        "http_response_code :< 400\n" +
        "http_response_code :>= 400\n" +
        "http_response_code :<= 400\n" +
        "\n" +
        "也可以组合无界范围运算符\n" +
        "http_response_code : ( > = 400 AND < 500 )\n" +
        "\n" +
        "转义：必须使用反斜杠转义以下字符：&& || : / + - ! ( ) { } [ ] ^ ' ~ * ?\n" +
        "resource:/posts/45326"
      }
    ]
  },
  {
    title:"Log4x高级语法",
    content:[
      {
        name:"字段过滤",
        text:"* |fields (field1,field2,field3)"
      },
      {
        name:"字段排序",
        text:"* |sort by field1.desc,field2.asc"
      },
      {
        name:"表格",
        text:"* |table (field1,field2,field3) sort by field1.desc,field4.asc"
      },
      {
        name:"stats统计语法",
        text:"平均值统计\n" +
        "1、带分组的平均值统计\n" +
        "\n" +
        "* |stats avg(avg_field) by group_field\n" +
        "\n" +
        "2、不带分组的平均值统计\n" +
        "\n" +
        "* |stats avg(avg_field)\n" +
        "\n" +
        "求和统计\n" +
        "1、带分组的求和统计\n" +
        "\n" +
        "* |stats sum(sum_field) by group_field\n" +
        "\n" +
        "2、不带分组的求和统计\n" +
        "\n" +
        "* |stats sum(sum_field)\n" +
        "\n" +
        "最大值统计\n" +
        "1、带分组的最大值统计\n" +
        "\n" +
        "* |stats max(max_field) by group_field\n" +
        "\n" +
        "2、不带分组的最大值统计\n" +
        "\n" +
        "* |stats max(max_field)\n" +
        "\n" +
        "最小值统计\n" +
        "1、带分组的最小值统计\n" +
        "\n" +
        "* |stats min(min_field) by group_field\n" +
        "\n" +
        "2、不带分组的最小值统计\n" +
        "\n" +
        "* |stats min(min_field)\n" +
        "\n" +
        "计数统计\n" +
        "1、带分组的计数统计\n" +
        "\n" +
        "* |stats count(count_field) by group_field\n" +
        "\n" +
        "2、不带分组的总数统计\n" +
        "\n" +
        "* |stats count(count_field)\n" +
        "\n" +
        "同个字段多维统计\n" +
        "1、带分组的同字段的多维统计\n" +
        "\n" +
        "* |stats es(field_name) by group_field\n" +
        "\n" +
        "2、不带分组的同字段多维统计\n" +
        "\n" +
        "* |stats es(field_name)\n" +
        "\n" +
        "多值统计\n" +
        "1、带分组的多值统计\n" +
        "\n" +
        "* |stats max(max_field) as maxValue, sum(sum_field) as sumValue by group_field\n" +
        "\n" +
        "2、不带分组的多值统计\n" +
        "\n" +
        "* |stats max(max_field) as maxValue, sum(sum_field) as sumValue\n" +
        "\n" +
        "时间间隔最大值统计\n" +
        "1、带分组的时间间隔最大值统计\n" +
        "\n" +
        "* |stats dhg_max(time_field,stats_field,interval) by group_field\n" +
        "\n" +
        "2、不带分组的时间间隔最大值统计\n" +
        "\n" +
        "* |stats dhg_max(time_field,stats_field,interval)\n" +
        "\n" +
        "时间间隔最小值统计\n" +
        "1、带分组的时间间隔最小值统计\n" +
        "\n" +
        "* |stats dhg_min(time_field,stats_field,interval) by group_field\n" +
        "\n" +
        "2、不带分组的时间间隔最小值统计\n" +
        "\n" +
        "* |stats dhg_min(time_field,stats_field,interval)\n" +
        "\n" +
        "时间间隔求和统计\n" +
        "1、带分组的时间间隔求和统计\n" +
        "\n" +
        "* |stats dhg_sum(time_field,stats_field,interval) by group_field\n" +
        "\n" +
        "2、不带分组的时间间隔求和统计\n" +
        "\n" +
        "* |stats dhg_sum(time_field,stats_field,interval)\n" +
        "\n" +
        "时间间隔平均值统计\n" +
        "1、带分组的时间间隔平均值统计\n" +
        "\n" +
        "* |stats dhg_avg(time_field,stats_field,interval) by group_field\n" +
        "\n" +
        "2、不带分组的时间间隔平均值统计\n" +
        "\n" +
        "* |stats dhg_avg(time_field,stats_field,interval)\n" +
        "\n" +
        "时间间隔计数统计\n" +
        "1、带分组的时间间隔计数统计\n" +
        "\n" +
        "* |stats dhg_count(time_field,stats_field,interval) by group_field\n" +
        "\n" +
        "2、带分组的时间间隔计数统计(去重)\n" +
        "\n" +
        "* |stats dhg_dc(time_field,stats_field,interval) by group_field\n" +
        "\n" +
        "3、不带分组的时间间隔计数统计\n" +
        "\n" +
        "* |stats dhg_count(time_field,stats_field,interval)\n" +
        "\n" +
        "4、不带分组的时间间隔计数统计(去重)\n" +
        "\n" +
        "* |stats dhg_dc(time_field,stats_field,interval)\n" +
        "\n" +
        "时间分段统计\n" +
        "* |stats dr(time_field,(time1_start,time1_end),(time2_start,time2_end))\n" +
        "\n" +
        "数值分段统计\n" +
        "* |stats range(num_field,(start1,end1),(start2,end2)) by group_field\n" +
        "\n" +
        "数值间隔统计\n" +
        "* |stats hg(num_field,interval)\n" +
        "\n" +
        "top统计\n" +
        "* |stats top(top_field,n)\n" +
        "\n" +
        "百分比统计\n" +
        "* |stats percentiles(field_name)\n" +
        "\n" +
        "地理分布统计\n" +
        "* |stats map(area)\n" +
        "\n" +
        "如果统计所有省份,area=province，如果统计某一省份，area=city\n" +
        "\n" +
        "移动均差统计\n" +
        "* |stats movingavg(time_field,interval,func(field_name))\n" +
        "\n" +
        "func支持count/max/min/sum/avg\n" +
        "\n" +
        "同比统计\n" +
        "* |stats yoy_compare(compare_type,interval,func(field_name))\n" +
        "\n" +
        "func支持count/max/min/sum/avg\n" +
        "\n" +
        "compare_type: day/week/month\n" +
        "\n" +
        "环比统计\n" +
        "* |stats mom_compare(interval,func(field_name))\n" +
        "\n" +
        "func支持count/max/min/sum/avg\n" +
        "\n" +
        "同比趋势统计\n" +
        "* |stats yoy_cv(compare_type,func(field_name))\n" +
        "\n" +
        "func支持count/max/min/sum/avg\n" +
        "\n" +
        "compare_type: day/week/month"
      }
    ]
  }
];
